package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.annotation.DataScope;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.DzCheweiMapper;
import com.ruoyi.system.domain.DzChewei;
import com.ruoyi.system.service.IDzCheweiService;


import com.ruoyi.common.core.domain.entity.SysRole;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.system.service.ISysRoleService;
import com.ruoyi.system.mapper.DzHuiyuanMapper;
import com.ruoyi.system.domain.DzHuiyuan;
import com.ruoyi.system.service.IDzHuiyuanService;

/**
 * 车位信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-08-17
 */
@Service
public class DzCheweiServiceImpl implements IDzCheweiService 
{
    @Autowired
    private DzCheweiMapper dzCheweiMapper;

    @Autowired
    private ISysRoleService sysRoleService;

    @Autowired
    private IDzHuiyuanService dzHuiyuanService;

    /**
     * 查询车位信息
     * 
     * @param cwId 车位信息主键
     * @return 车位信息
     */
    @Override
    public DzChewei selectDzCheweiByCwId(Long cwId)
    {
        return dzCheweiMapper.selectDzCheweiByCwId(cwId);
    }

    /**
     * 查询车位信息列表
     * 
     * @param dzChewei 车位信息
     * @return 车位信息
     */
    @Override
    @DataScope(deptAlias = "d", userAlias = "u")
    public List<DzChewei> selectDzCheweiList(DzChewei dzChewei)
    {

        return dzCheweiMapper.selectDzCheweiList(dzChewei);
    }

    @Override
    public List<DzChewei> selectDzCheweiListWeb(DzChewei dzChewei)
    {
        return dzCheweiMapper.selectDzCheweiList(dzChewei);
    }

    /**
     * 新增车位信息
     * 
     * @param dzChewei 车位信息
     * @return 结果
     */
    @Override
    public int insertDzChewei(DzChewei dzChewei)
    {
        dzChewei.setCreateTime(DateUtils.getNowDate());
        return dzCheweiMapper.insertDzChewei(dzChewei);
    }

    /**
     * 修改车位信息
     * 
     * @param dzChewei 车位信息
     * @return 结果
     */
    @Override
    public int updateDzChewei(DzChewei dzChewei)
    {
        return dzCheweiMapper.updateDzChewei(dzChewei);
    }

    /**
     * 批量删除车位信息
     * 
     * @param cwIds 需要删除的车位信息主键
     * @return 结果
     */
    @Override
    public int deleteDzCheweiByCwIds(Long[] cwIds)
    {
        return dzCheweiMapper.deleteDzCheweiByCwIds(cwIds);
    }

    /**
     * 删除车位信息信息
     * 
     * @param cwId 车位信息主键
     * @return 结果
     */
    @Override
    public int deleteDzCheweiByCwId(Long cwId)
    {
        return dzCheweiMapper.deleteDzCheweiByCwId(cwId);
    }
}
